<html>
<script src="/js/jquery-2.1.1.min.js" type="text/javascript"></script>
<script src="/js/ckeditor/ckeditor.js" type="text/javascript"></script>
<link href="/js/ckeditor/contents.css" type="text/css" rel="stylesheet">
<script src="/js/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<link href="/js/bootstrap/css/bootstrap.min.css" type="text/css" rel="stylesheet">
<script src="/js/bootstrap-treeview/dist/bootstrap-treeview.min.js" type="text/javascript"></script>
<link href="/js/bootstrap-treeview/dist/bootstrap-treeview.min.css" type="text/css" rel="stylesheet">
<script src="/js/bootStrap-addTabs/bootstrap.addtabs.min.js" type="text/javascript"></script>
<link href="/js/bootStrap-addTabs/bootstrap.addtabs.css" type="text/css" rel="stylesheet">
<script src="/js/toastr/toastr.min.js" type="text/javascript"></script>
<link href="/js/toastr/toastr.css" type="text/css" rel="stylesheet">
<script src="/js/bootstrap-table/dist/bootstrap-table.min.js" type="text/javascript"></script>
<link href="/js/bootstrap-table/dist/bootstrap-table.min.css" type="text/css" rel="stylesheet">
<script src="/js/bootstrap-table/dist/locale/bootstrap-table-zh-CN.min.js" type="text/javascript"></script>
<script src="/js/bootstrap-fileinput/js/fileinput.min.js" type="text/javascript"></script>
<link href="/js/bootstrap-fileinput/css/fileinput.min.css" type="text/css" rel="stylesheet">
<script src="/js/bootstrap-fileinput/js/locales/zh.js" type="text/javascript"></script>
<script src="/js/bootstrap-dialog/dist/js/bootstrap-dialog.min.js" type="text/javascript"></script>
<link href="/js/bootstrap-dialog/dist/css/bootstrap-dialog.min.css" type="text/css" rel="stylesheet">
<script src="/js/zTreev3/js/jquery.ztree.all.js" type="text/javascript"></script>
<link href="/js/zTreev3/css/zTreeStyle/zTreeStyle.css" type="text/css" rel="stylesheet">
<style>
    .container-fluid {
        margin-top: 20px;
    }
</style>
<head>
    <title>登录</title>
    <script type="text/javascript">

        //登录
        function login() {
            if ($("#firstname").val() == '') {
                toastr.error("账号不能为空");
                return;
            }
            if ($("#lastname").val() == '') {
                toastr.error("密码不能为空");
                return;
            }
            $.get("/AdminUser/login", $("#loginandregister").serialize(), function (pm) {
                if (pm.code) {
                    location.href = "/AdminUser/tzResource";
                } else {
                    toastr.error(pm.message);
                }
            }, "json")
        }
    </script>
</head>
<body>
<center>
    <div style="height: 200px"></div>
    <div class="panel panel-primary" style="width: 400px">
        <div class="panel-heading">
            <h3 class="panel-title">登录</h3>
        </div>
        <div class="panel-body">
            <div>
                <form class="form-horizontal" role="form" id="loginandregister">
                    <div class="form-group">
                        <label for="firstname" class="col-sm-2 control-label">账号</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="firstname" placeholder="请输入账号" name="userName">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="lastname" class="col-sm-2 control-label">密码</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="lastname" placeholder="请输入密码" name="userPwd">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                            <button type="button" class="btn btn-info" onclick="login()">登录</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</center>
</body>
</html>
